package com.example.multimedia

import android.os.Bundle
import android.widget.Button
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.multimedia.c_audio.CAActivity
import com.example.multimedia.camera.BAActivity
import com.example.multimedia.notification.AAActivity
import com.example.multimedia.util.launchActivity
import com.example.multimedia.video.DAActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        initButtons()
        launchActivity<DAActivity>()
    }

    private fun initButtons() {
        findViewById<Button>(R.id.notification).setOnClickListener {
            launchActivity<AAActivity>()
        }
        findViewById<Button>(R.id.camera).setOnClickListener {
            launchActivity<BAActivity>()
        }
        findViewById<Button>(R.id.audio).setOnClickListener {
            launchActivity<CAActivity>()
        }
        findViewById<Button>(R.id.video).setOnClickListener {
            launchActivity<DAActivity>()
        }
    }
}